﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PowerBooking.RSE.Utility.Helpers
{
    public class CommonHelper
    {
        public static List<List<T>> ConvertListToGroup<T>(List<T> source, int groupMemberCount)
        {
            var group = new List<List<T>>();
            for (var i = 0; i < source.Count; i = i + groupMemberCount)
            {

                group.Add(source.GetRange(i, source.Count - i < groupMemberCount ? (source.Count - i) : groupMemberCount));
            }
            return group;
        }


    }
}
